Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

515
Views
php Laravel ~ Attribute [controller] does not exist

I am trying to set up an Route Controller in my Laravel project and I have set up the controller and also the route.

However, when I load the route in the web.php then it produces an error when I try to navigate to that page in the browser of Attribute [controller] does not exist

Here is the code..

<?php
   namespace CMS\Http\Controllers\Auth;

   use CMS\Http\Controllers\Controller;
   use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{

use AuthenticatesUsers {
    logout as performLogout;
}

/**
 * Where to redirect users after login.
 *
 */
protected $redirectTo;

/**
 * Create a new controller instance.
 *
 */

public function __construct()
{
    $this->redirectTo = route('backend.dashboard');
    $this->middleware('guest')->except('logout');
}

public function logout(Request $request)
{
    $this->performLogout($request);
    return redirect()->route('auth.login');
}
}

And then in the web.php I have this...

Route::controller('auth', 'Auth\LoginController', [
    'getLogin' => 'auth.login'
]);
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The controller method is deprecated since Laravel 5.3. But now, you can use the resource method, which is meant for the same purpose as the controller method.

Like This:

Route::resource('auth', 'LoginController');

or

Route::get('/auth','LoginController');

Route::post('/auth','LoginController');
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!